package com.ruoyi.project.inspection.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.inspection.domain.ViOperLog;
import com.ruoyi.project.inspection.mapper.ViOperLogMapper;
import com.ruoyi.project.inspection.service.IViOperLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车辆年检操作记录Service业务层处理
 *
 * @author ruoyi
 * @date 2020-07-17
 */
@Service
public class ViOperLogServiceImpl implements IViOperLogService {

    @Autowired
    private ViOperLogMapper viOperLogMapper;

    /**
     * 查询车辆年检操作记录
     *
     * @param id 车辆年检操作记录ID
     * @return 车辆年检操作记录
     */
    @Override
    public ViOperLog selectViOperLogById(Long id) {
        return viOperLogMapper.selectViOperLogById(id);
    }

    /**
     * 查询车辆年检操作记录列表
     *
     * @param viOperLog 车辆年检操作记录
     * @return 车辆年检操作记录
     */
    @Override
    public List<ViOperLog> selectViOperLogList(ViOperLog viOperLog) {
        return viOperLogMapper.selectViOperLogList(viOperLog);
    }

    /**
     * 新增车辆年检操作记录
     *
     * @param viOperLog 车辆年检操作记录
     * @return 结果
     */
    @Override
    public int insertViOperLog(ViOperLog viOperLog) {
        viOperLog.setCreateTime(DateUtils.getNowDate());
        return viOperLogMapper.insertViOperLog(viOperLog);
    }

    /**
     * 修改车辆年检操作记录
     *
     * @param viOperLog 车辆年检操作记录
     * @return 结果
     */
    @Override
    public int updateViOperLog(ViOperLog viOperLog) {
        return viOperLogMapper.updateViOperLog(viOperLog);
    }

    /**
     * 批量删除车辆年检操作记录
     *
     * @param ids 需要删除的车辆年检操作记录ID
     * @return 结果
     */
    @Override
    public int deleteViOperLogByIds(Long[] ids) {
        return viOperLogMapper.deleteViOperLogByIds(ids);
    }

    /**
     * 删除车辆年检操作记录信息
     *
     * @param id 车辆年检操作记录ID
     * @return 结果
     */
    @Override
    public int deleteViOperLogById(Long id) {
        return viOperLogMapper.deleteViOperLogById(id);
    }
}
